Skip to content

Fixes to handle 404 exceptions when export policy and ontap volume ar…#73

Open
sandeeplocharla wants to merge 2 commits into
mainfrom
feature/CSTACKEX-177
Open

Fixes to handle 404 exceptions when export policy and ontap volume ar…#73
sandeeplocharla wants to merge 2 commits into
mainfrom
feature/CSTACKEX-177

Conversation

@sandeeplocharla

@sandeeplocharla sandeeplocharla commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Fixes to handle 404 exceptions when export policy and ontap volume are missing during storagepool delete workflow

Description

This PR...
Has fixes to handle 404 Not found exceptions in case of 'ExportPolicy' and 'Volume' deletion.

Screenshots (if appropriate):

Screenshot 2026-07-01 at 3 13 00 PM

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • [] Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

How did you try to break this feature and the system with this change?

} catch (FeignException.FeignClientException e) {
} catch (FeignException e) {
if (e.status() == 404) {
logger.warn("deleteStorageVolume: Volume '{}' not found in ONTAP (may not have been created), treating as no-op", volume.getName());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this part "(may not have been created)"

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

Copilot AI review requested due to automatic review settings July 10, 2026 07:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves resilience of the ONTAP storagepool delete workflow by treating ONTAP “404 Not Found” responses as a no-op when attempting to delete already-missing export policies and volumes, reducing avoidable failures/noise during cleanup.

Changes:

  • Handle FeignException with HTTP 404 for export policy deletion (NAS) as a no-op.
  • Handle FeignException with HTTP 404 for volume deletion as a no-op.
  • Minor import reordering/cleanup in the touched classes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java Treats 404 during export policy deletion as a no-op to avoid failing storagepool deletion when the policy is already missing.
plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java Treats 404 during volume deletion as a no-op to avoid failing cleanup when the volume is already missing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 398 to 399
logger.error("Exception while deleting volume: ", e);
throw new CloudRuntimeException("Failed to delete volume: " + e.getMessage());
Comment on lines +184 to +188
} catch (FeignException e) {
if (e.status() == 404) {
logger.warn("deleteAccessGroup: Export policy '{}' not found in ONTAP, treating as no-op", exportPolicyName);
return;
}
Comment on lines +393 to +397
} catch (FeignException e) {
if (e.status() == 404) {
logger.warn("deleteStorageVolume: Volume '{}' not found in ONTAP, treating as no-op", volume.getName());
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants